<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>首页</title>
    <script src="https://lib.baomitu.com/jquery/3.6.0/jquery.js"></script>
    <!-- <embed src="http://n.sinaimg.cn/caitong/activity/tcgyj/wap/media/bg.mp3" hidden="true" autostart="true" loop="true"> -->
    <link href="css/index.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="js/flexible.js"></script>

    <style>
        html,
        body {
            width: 100vw;
            height: 100vh;
            overflow: hidden;
        }


        .music {
            position: fixed;
            z-index: 1000;
            right: 9px;
            top: 9px;
            width: 35px;
            height: 35px;
        }

        .music .music-btn {
            display: block;
            width: 35px;
            height: 35px;
            background-image: url('./images/music-0.png');
            background-size: 35px 35px;
        }
        @keyframes musicPlay {
            0% {
                -webkit-transform: rotate(0deg);
                transform: rotate(0deg);
            }

            50% {
                -webkit-transform: rotate(180deg);
                transform: rotate(180deg);
            }

            100% {
                -webkit-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }
    </style>
</head>

<body>
    <audio id="bgMusic" src="http://n.sinaimg.cn/caitong/activity/tcgyj/wap/media/bg.mp3" autoplay="autoplay"></audio>
    <div id="audioBtn" class="music mscBtn">
        <a class="music-btn ds-no"></a>
    </div>
    <div class="container1">
        <img src="./images/2.gif" alt="" class="img00">
        <div class="section">
            <div class="content">
                <div class="top">
                    2021年湖北体彩“为青春添彩”计划已正式启动，百万<span
                        style="position: relative;
                    top: -0.1rem;">+</span>资金助力高校学子圆梦，欢迎我省各大高校的学子和社团报名参与。推广体彩公益文化，助力大学生创业，充分展示当代大学生的爱心、热情与活力，共同助力高校社团文化的蓬勃发展。
                </div>
                <div class="middle">
                    <div>
                        <a href=""><img src="./images/27.png" alt="" class="img05"></a>
                        <a href=""><img src="./images/03.png" alt="" class="img03"></a>
                        <a href=""><img src="./images/04.png" alt="" class="img04"></a>
                        <a href=""><img src="./images/05.png" alt="" class="img05"></a>
                        <a href=""><img src="./images/06.png" alt="" class="img06"></a>
                    </div>
                </div>
                <div class="bottom">
                    *在法律允许的范围内，活动的最终解释权归湖北省体育彩票管理中心所有*
                </div>
            </div>
        </div>
    </div>
</body>

<script>
    
    

    /*
              * 背景音乐
              * 1.打开页面，音乐自动播放，图标自动旋转
              * 2.点击图标，音乐停止播放，图标停止旋转
              */

    var bgMusic = document.getElementById("bgMusic");
    var audioBtn = document.getElementById("audioBtn");
    var rot = 10 - 0;
    var timer;
    var is_zhuan = false;

    audioBtn.addEventListener("touchstart", function () {
        if (bgMusic.paused || is_zhuan == true) {
            bgMusic.play();
            timer = window.setInterval(begin, 10);
            is_zhuan = false;
            $(".music-btn").css('background-image',"url('./image/music-0.png')")
            $("#audioBtn").removeClass("pause").addClass("play");
            
        } else {
            bgMusic.pause();
            window.clearInterval(timer);
            is_zhuan = true;
            $(".music-btn").css('background-image',"url('./image/music-1.png')")
            $("#audioBtn").removeClass("play").addClass("pause");
          
        }
    });

    timer = window.setInterval(begin, 10);

    function begin() {
        document.getElementById("audioBtn").style.transform = "rotatez(" + rot + "deg)";
        rot += 1;
    }

    function myPlay(){
        var audio = document.getElementById('bgMusic'),
            play = function(){
                audio.play();
                document.removeEventListener("touchstart",play, false);
            };
        audio.play();
        document.addEventListener("WeixinJSBridgeReady", function () {//微信
            play();
        }, false);
        document.addEventListener('YixinJSBridgeReady', function() {//易信
            play();
        }, false);
        document.addEventListener("touchstart",play, false);
    }
    myPlay()
</script>

</html>